﻿using System;
using System.Drawing;

namespace aboveXWords.GUI
{
  /// <summary>
  /// A number is a square holding a letter and a number.
  /// </summary>
  [Serializable]
  internal class Number : Letter
  {
    public Number(char c, int value) : base(c)
    {
      Value = value;
    }

    /// <summary>
    /// Set or get the numeric value.
    /// </summary>
    public int Value { get; set; }

    /// <summary>
    /// Draw a number in the upper right corner.
    /// </summary>
    /// <param name="graphics"></param>
    protected internal override void Paint(System.Windows.Forms.Graphics graphics)
    {
      base.Paint(graphics);
      graphics.DrawString(Value.ToString(),
                                         Properties.Settings.Default.LetterFont,
                                         Painter.Colors.NumberBrush,
                                         new RectangleF(Rectangle.X, Rectangle.Y, Rectangle.Width / 15f, Rectangle.Height / 15f));
    }
  }
}